package com.neiquan.backstage.notice.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neiquan.backstage.common.util.ExtraSpringHibernateTemplate;
import com.neiquan.backstage.notice.NoticeService;
import com.neiquan.backstage.pub.bsc.dao.po.Notice;

@Service
public class NoticeServiceImpl implements NoticeService {
	private static Class<?> poc = Notice.class;
	@Autowired
	private ExtraSpringHibernateTemplate extraSpringHibernateTemplate;

	@Override
	public Notice queryById(Integer id) {
		return extraSpringHibernateTemplate.findFirstOneByPropEq(poc, "noticeId", id);
	}
	@Override
	public List<Notice> queryAll(Integer memberId) {
			List<Notice> find = (List<Notice>) extraSpringHibernateTemplate.getHibernateTemplate().find("From Notice where memberId=?", memberId);
			return find;
			
	}
}
